const { Schema } = require("./config");
const ObjectId = Schema.Types.ObjectId;   //mogoDB的文档唯一主键
const ArticleSchema = new Schema({
  title:String,
  content:String,
  author:{   //关联users的表,用user表的ID值来进行关联。这个表示author必须是类型为ObjectId，并且要关联users表
    type:ObjectId,
    ref:"users"
  },
  tips:String,
},{
  versionKey:false,
  timestamps:{
    createdAt:"createdTime",
    updateAt:''
  }
});

module.exports = ArticleSchema;
